# $Id: PKGBUILD 88293 2013-04-16 02:22:14Z fyan $
# Maintainer: Felix Yan <felixonmars@gmail.com>

pkgbase=opencc
pkgname=(opencc opencc-doc)
pkgver=0.4.2
pkgrel=2
url="http://code.google.com/p/opencc/"
arch=('i686' 'x86_64')
license=('Apache')
makedepends=('cmake' 'doxygen')
source=("http://opencc.googlecode.com/files/${pkgbase}-${pkgver}.tar.gz")

build() {
  cd "$srcdir/${pkgbase}-${pkgver}"
  cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DBUILD_DOCUMENTATION:BOOL=ON
  make
}

package_opencc() {
  pkgdesc="Library for Open Chinese Convert"
  depends=('glibc')

  cd "$srcdir/${pkgbase}-${pkgver}"
  make DESTDIR="${pkgdir}" install
  
  # Remove docs - install in splitted package
  rm -r "$pkgdir/usr/share/opencc/doc"
}

package_opencc-doc() {
  pkgdesc="Documentation for Library for Open Chinese Convert"

  cd "$srcdir/${pkgbase}-${pkgver}/doc"
  make DESTDIR="${pkgdir}" install

  # Remove manpages - already installed in main package
  rm -r "$pkgdir/usr/share/man"
}

md5sums=('d5c001098e824dae0e3debb1b864304b')
